<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'contact-form',
	'enableClientValidation'=>FALSE,
	'clientOptions'=>array(
		'validateOnSubmit'=>FALSE,
	),
        'htmlOptions'=>array('class'=>'definewidth m20 form-horizontal')
)); ?>
<table class="table table-bordered table-hover m10">
    <?php echo $form->errorSummary($model);?>
    <tr>
        <td width="10%" class="tableleft">选择章名称</td>
        <td>
            <?php echo $form->dropdownList($model,'chapter_id',$chapter,array(
                'ajax' => array(
                    'type'=>'POST', 
                    'url'=>$this->createUrl('/entry/verseList'),
                    //Style: CController::createUrl('currentController/methodToCall')
                    'update'=>'#Article_verse_id', //selector to update
                    'data'=>array('cid'=>"js:this.value"), 
                    //leave out the data key to pass all form values through
                )
            ))?>
        </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">选择节名称</td>
        <td>
            <?php echo $form->dropdownList($model,'verse_id',array(),array(
                'ajax' => array(
                    'type'=>'POST', 
                    'url'=>$this->createUrl('/entry/entryList'),
                    //Style: CController::createUrl('currentController/methodToCall')
                    'update'=>'#Article_entry_id', //selector to update
                    'data'=>array('eid'=>"js:this.value"), 
                    //leave out the data key to pass all form values through
                )
            ))?>
        </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">选择条目名称</td>
        <td>
            <?php echo $form->dropdownList($model,'entry_id',array())?>
        </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">名称</td>
        <td>
            <?php echo $form->textField($model,'name'); ?>
            <?php echo $form->error($model,'name'); ?>
        </td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">内容</td>
        <td>
            <?php $this->widget('ext.ueditor.editor',array(
                    'content'=>$model->content,
                    'config'=>array(
                            'toolbars'=>array(array('fullscreen', 'source', 'undo', 'redo', 'bold','simpleupload','insertimage')),
                            'autoHeightEnabled'=>TRUE,
                            'autoFloatEnabled'=>TRUE,
                            'serverUrl'=>'/index.php/fueditor/index'
                        ),
                    'width'=>'800px',
                    'height'=>'400px',
                    'name'=>'Article[content]',
                    )
                );
            ?>
        </td>
    </tr>
    <tr>
        <td class="tableleft">状态</td>
        <td>
            <?php
                $radio=CHtml::activeRadioButtonList($model, 'state', array('0'=>'禁用','1'=>'启用'),     array('template'=>'{input}{label}','separator'=>"    "));
                $radio= str_replace("<label", "<span", $radio);  
                $radio= str_replace("</label", "</span", $radio);  
                echo $radio;      
            ?>
             <?php echo $form->error($model,'state'); ?>
<!--            <input type="radio" name="status" value="0" checked/> 启用
            <input type="radio" name="status" value="1"/> 禁用-->
        </td>
    </tr>
    <tr>
        <td class="tableleft"></td>
        <td>
            <button type="submit" class="btn btn-primary" type="button">保存</button> &nbsp;&nbsp;<a class="btn btn-success" name="backid" id="backid" href="<?php echo $this->createUrl('/chapter');?>">返回列表</a>
        </td>
    </tr>
</table>

<?php $this->endWidget(); ?>
</div>